|
|
@@ -23,28 +23,38 @@ def main() -> int:
|
|
|
print(f"{config.primary_entity.config_id}:")
|
|
|
for dp in config.primary_entity.dps():
|
|
|
if dp.id not in dps.keys():
|
|
|
- print(f" {dp.name} missing from data")
|
|
|
+ print(f" {dp.name} missing from data")
|
|
|
if not dp.optional:
|
|
|
- print(f" dp {dp.id} is REQUIRED!!!!")
|
|
|
+ print(f">> dp {dp.id} is REQUIRED!!!!")
|
|
|
elif not _typematch(dp.type, dps.get(dp.id)):
|
|
|
print(
|
|
|
- f" {dp.name} type MISMATCH, expected {dp.type.__name__}, got {dps.get(dp.id)}!!!"
|
|
|
+ f">> {dp.name} type MISMATCH, expected {dp.type.__name__}, got {dps.get(dp.id)}!!!"
|
|
|
)
|
|
|
else:
|
|
|
- print(f" {dp.name}: {dp.get_value(device)} from {dp.values(device)}")
|
|
|
+ values = dp.values(device)
|
|
|
+ if values:
|
|
|
+ values = f" from {values}"
|
|
|
+ else:
|
|
|
+ values = ""
|
|
|
+ print(f" {dp.name}: {dp.get_value(device)}{values}")
|
|
|
for entity in config.secondary_entities():
|
|
|
print(f"{entity.config_id}:")
|
|
|
for dp in entity.dps():
|
|
|
if dp.id not in dps.keys():
|
|
|
- print(f" {dp.name} missing from data")
|
|
|
+ print(f" {dp.name} missing from data")
|
|
|
if not dp.optional:
|
|
|
- print(f" dp {dp.id} is REQUIRED!!!!")
|
|
|
+ print(f">> dp {dp.id} is REQUIRED!!!!")
|
|
|
elif not _typematch(dp.type, dps.get(dp.id)):
|
|
|
print(
|
|
|
- f" {dp.name} type MISMATCH, expected {dp.type.__name__}, got {dps.get(dp.id)}!!!"
|
|
|
+ f">> {dp.name} type MISMATCH, expected {dp.type.__name__}, got {dps.get(dp.id)}!!!"
|
|
|
)
|
|
|
else:
|
|
|
- print(f" {dp.name}: {dp.get_value(device)}")
|
|
|
+ values = dp.values(device)
|
|
|
+ if values:
|
|
|
+ values = f" from {values}"
|
|
|
+ else:
|
|
|
+ values = ""
|
|
|
+ print(f" {dp.name}: {dp.get_value(device)}{values}")
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|