Exemplo n.º 1
0
    # parameter is created it gets automatically assigned this default header.

    semantic_manager.set_default_header(header)
    my_building = Building(id="building1")

    # ## 2.2 Immutability
    #
    # These defining information of an instance are immutable and can not
    # be changed after the creation.
    # They are further bundled into an identifier object that is used as an
    # identity by the system: The InstanceIdentifier

    # We can have a look at this identifier, and see that the header was
    # correctly set:
    print("\u0332".join("Instance Identifier of my_building:"))
    print(my_building.get_identifier())
    print("")

    # ## 2.3 Device Classes
    #
    # Device-classes are a subtype of normal classes, they work as normal
    # classes, but posses additional field types and information about the
    # iot device that they are representing
    my_sensor = Sensor(id="sensor1")
    my_outlet = Outlet(id="o1")

    # All information about the device is gathered in the device settings
    # property of the instance
    # After initialisation all values are None:
    print("\u0332".join("Device settings:"))
    print(my_sensor.device_settings)