Behaviour of HardwareObject
Looking at the code, i think it would be better to rework HardwareObject.__getattr__
the following way:
- Check if it's part of the signature and raise
AttributeError
if the key does not exist. - Raise
RuntimeError("Object 'foo' is offline")
if the device is offline (or a specific exception), actually__getattr__
returnsNone
Also we have to be really careful with the overloaded properties.
Actually the following public API can't be used for property names or callable names.
name -> should be reserved work
type -> became reserved keyword
errors -> became reserved keyword
subscribe -> internal bliss client? could be hidden as private
set_evented -> internal bliss client? could be hidden as private
properties -> could be hidden as private
update_state -> internal bliss client use? could be hidden as private
We should as much as possible
-
Hide the function used for internal use only
-
Tag some keys as reserved words that must not be used in the rest api object description
-
We should maybe expose
online
? -
Finally we should probably avoid the same keys in callables and properties