How to access groups in pyscript?

I have a group defined in configuration.yaml as

group:
  michael:
    name: michael
    entities:
      - switch.michael_bureau_gauche
      - switch.michael_bureau_droite
      - switch.michael_lampe_haute
      - switch.michael_lampe_mur

I would like to access it via pyscript, specifically the entities section. How can I do that?


A few comments:

When I log(group.michael) I get on or off, which corresponds to the state of the group (if at least one switch is ‘on’ then it is ‘on’, otherwise it is ‘off’).

What I actually need to do is to toggle the whole group, which means addressing each of its elements and turning it on or off depending on the state of the group - thus the need for the entities. It would be great if I could just “toggle the group” but it won’t work, mostly because the groups are a mixture of switch and light and I would need to run the service homeassistant_toggle on it (which again I do not think is possible)

For those looking for an answer to this question, please see this github issue.