Skip to content

logging devicestate #20

@artooksanen

Description

@artooksanen

Just a minor issue. I started using devicestate in my telescope driver and it is working just fine, but the log file is not showing the actual values of the array:

in telescope.py there is

val = []
val.append(StateValue('Altitude',  rade.get_altitude()))
val.append(StateValue('AtHome', False))
val.append(StateValue('AtPark', False))
val.append(StateValue('Azimuth', rade.get_azimuth()))
val.append(StateValue('Declination', rade.get_de()))
val.append(StateValue('IsPulseGuiding', False))
val.append(StateValue('RightAscension', rade.get_ra()))
val.append(StateValue('SideOfPier', 0 ))
val.append(StateValue('SiderealTime',rade.get_siderealtime()))
val.append(StateValue('Slewing', rade.is_slewing()))
val.append(StateValue('Tracking', not rade.is_slewing()))
val.append(StateValue('UTCDate', rade.utcdate()))
val.append(StateValue('TimeStamp', rade.utcdate()))
resp.text = PropertyResponse(val, req).json

on the log file it prints like this:

2025-07-13T07:31:21.199 INFO 192.168.8.104 <- [<shr.StateValue object at 0x74bf3ad8>, <shr.StateValue object at 0x74b90e68>, <shr.StateValue object at 0x74b90e20>, <shr.StateValue object at 0x74b90df0>, <shr.StateValue object at 0x74b90f28>, <shr.StateValue object at 0x74b90f40>, <shr.StateValue object at 0x74b90e80>, <shr.StateValue object at 0x74b90ee0>, <shr.StateValue object at 0x74b90f10>, <shr.StateValue object at 0x74b90ef8>, <shr.StateValue object at 0x74b90fa0>, <shr.StateValue object at 0x74b90fd0>, <shr.StateValue object at 0x74baa028>]

The returned json is ok:

{"ServerTransactionID": 391, "ClientTransactionID": 44224, "Value": [{"Name": "Altitude", "Value": 27.655631235577058}, {"Name": "AtHome", "Value": false}, {"Name": "AtPark", "Value": false}, {"Name": "Azimuth", "Value": 185.94833550538928}, {"Name": "Declination", "Value": 0.0}, {"Name": "IsPulseGuiding", "Value": false}, {"Name": "RightAscension", "Value": 4.577978189499829}, {"Name": "SideOfPier", "Value": 0}, {"Name": "SiderealTime", "Value": 4.92908930061094}, {"Name": "Slewing", "Value": false}, {"Name": "Tracking", "Value": true}, {"Name": "UTCDate", "Value": "2025-07-13T10:47:01.374451"}, {"Name": "TimeStamp", "Value": "2025-07-13T10:47:01.374523"}], "ErrorNumber": 0, "ErrorMessage": ""}

arto

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions