frequenz-floss / frequenz-sdk-python

Frequenz Python Software Development Kit (SDK)
https://frequenz-floss.github.io/frequenz-sdk-python/
MIT License
13 stars 17 forks source link

Add method to check if the microgrid is connected to the grid #787

Open daniel-zullo-frequenz opened 10 months ago

daniel-zullo-frequenz commented 10 months ago

What's needed?

Currently, the user needs to walk the component graph to check if there is a grid component meaning that the microgrid is connected to the grid.

Proposed solution

Implement the is_connected() method in Grid as a shortcut to find out if the microgrid is connected to the grid or not. Alternatively the method can be implemented in the component graph.

Additional context

Originally suggested in https://github.com/frequenz-floss/frequenz-sdk-python/pull/758#discussion_r1397251645

llucax commented 10 months ago

FYI @shsms @matthias-wende-frequenz, it would be good to confirm if you think this is a good idea or if you see any problems with it.