Sleeping mode and flashing firmware

Hello I have inserted the sleeping mode in my code. But if the device is in sleeping mode it is not possible to flash a firmware, currently I use the command particle flash --local tinker and then I flash the modified code, is there another way? in case I would like to do it remotely what solution? Thanks

It's not possible because when the device is asleep it's not running, so there's no way to send functions, variables, subscriptions, or OTA, to it.

Some cellular devices allow wake on network, which allows the device to wake when the cloud requests it. However this is not possible on Wi-Fi devices. On the Photon, the Wi-Fi stack runs on the MCU, so it needs to be running to process Wi-Fi.

The recommended way is to use a product. When you release a product firmware version to a device and it's asleep, it will get the update when it wakes and reconnects to the cloud.

I'm actually using a photon Thanks