zxdavb / ramses_cc

HA integration for CH/DHW and HVAC systems that use the RAMSES II RF protocol
GNU General Public License v3.0
80 stars 17 forks source link

Packet log not rotating in config_flow #187

Closed ghoti57 closed 5 months ago

ghoti57 commented 6 months ago

packet.log doesn't seem to be rotating. The rotation appears to have stopped when I switched form 0.31.x to 0.41.x

configuration.yaml contained

ramses_cc:
  ..
  packet_log: evohome/packet.log
  ..

core.config_entries contains

            "packet_log": {
            "file_name": "evohome/packet.log"
          },
Kars-de-Jong commented 5 months ago

I noticed this too. When you look at the setting dialog it does show 7, but is not actually saved (probably because it is the default). And apparently the default behaviour changed to "no rotation" instead of 7. I solved it by setting it to 8 and then back to 7 again.

zxdavb commented 5 months ago

I have identified the problem. Fix coming.

Until then, you can enter this (i.e. explicitly specify the rotation policy), as a workaround:

"packet_log": {
    "file_name": "packet.log", 
    "rotate_backups": 7
}
zxdavb commented 5 months ago

I believe this is now fixed with 23e0d806298da7011db94ecd968ab5887f4e2ecc

Changed from:

CONFIG_SCHEMA = cv.deprecated(DOMAIN, raise_if_present=False)

... to:

CONFIG_SCHEMA = vol.All(
    cv.deprecated(DOMAIN, raise_if_present=False),
    vol.Schema({DOMAIN: SCH_DOMAIN_CONFIG}, extra=vol.ALLOW_EXTRA),
)