If other devices (e.g. DVD player) are part of the setup, then it's possible the chromecast shut-down trigger could power things down when (for example) watching a DVD. It should be possible to check if the chromecast is the active device, and only shut down if it is the active device. This will need to know what the CEC address of the chromecast device is (need to determine this in setup, or read from osd_string), and should probably have a command line option to enable this behaviour.