Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement read and describe on the DAE configuration signals #25

Open
rerpha opened this issue Aug 23, 2024 · 0 comments
Open

Implement read and describe on the DAE configuration signals #25

rerpha opened this issue Aug 23, 2024 · 0 comments

Comments

@rerpha
Copy link
Contributor

rerpha commented Aug 23, 2024

If we want sub-values in the XML-encoded DAE configuration signals to be emitted in documents, we need to implement read and describe. We need to do this manually rather than via StandardReadable.

It's not immediately obvious that most of these would ever want to be emitted in documents. But if we do want to do this, an example of how to do this for one signal is:

    async def read(self) -> Dict[str, Reading]:
        reading = await self.period_settings.read()
        period_settings = convert_xml_to_period_settings(reading[self.period_settings.name]["value"])

        ts = reading[self.period_settings.name]["timestamp"]

        return {
            f"{self.name}-periods_soft_num": {
                "value": period_settings.periods_soft_num,
                "timestamp": ts,
            }
        }

    async def describe(self) -> Dict[str, DataKey]:
        return {
            f"{self.name}-periods_soft_num": {
                "dtype": "number",
                "shape": [],
                "source": self.period_settings.source
            }
        }
@Tom-Willemsen Tom-Willemsen changed the title dae Implement read and describe on the DAE configuration signals Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant